package cn.wolfcode.crm.query;

import com.alibaba.druid.util.StringUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter@Setter
public class AccidentQueryObject extends QueryObject {
    private String keyword;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GTM+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginTime;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GTM+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;
    private Integer state = -1;
    public String getKeyword(){
        if(StringUtils.isEmpty(keyword)){
            return null;
        }
        return keyword;
    }
    public Integer getState(){
        if(state==null){
            return -1;
        }
        return state;
    }
}
